class Users::UserSettingController < ApplicationController
  def index
  end
  
  def edit_pwd
    _old_pwd = params[:user][:old_password]
    _pwd = params[:user][:password]
    _pwd_confirm = params[:user][:password_confirmation]
    @code  = "200"

    if current_user.valid_password?(_old_pwd)
      if !current_user.blank? && _pwd == _pwd_confirm
        current_user.password = _pwd
        current_user.unencrypted_pwd = _pwd
        if current_user.save
          sign_in(current_user, :bypass => true)
        end
      end
    else
      @code = "500"
    end
  end
end
